package cn.edu.ctbu.labtest.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 实现页面跳转
 **/
@Controller
@RequestMapping("/toPage")
public class PageController {
    /**
     * 去到登录页面 login/user.html
     * @return
     */
    @RequestMapping("/login/{page}")
    public String toPage(@PathVariable String page) {
        String url = "login/" + page;
        return url;
    }

    /**
     * 去到学生表页面 student/list.html
     * @return
     */
    @RequestMapping("/student/{page}")
    public String toStuPage(@PathVariable String page) {
        String url = "student/" + page;
        return url;
    }

    /**
     * 去到成绩表页面 sc/sclist.html
     * @return
     */
    @RequestMapping("/sc/{page}")
    public String toScPage(@PathVariable String page) {
        String url = "sc/" + page;
        return url;
    }

    /**
     * 去到教师表页面 teacher/tlist.html
     * @return
     */
    @RequestMapping("/teacher/{page}")
    public String toTPage(@PathVariable String page) {
        String url = "teacher/" + page;
        return url;
    }

    /**
     * 去到授课表页面 course/clist.html
     * @return
     */
    @RequestMapping("/course/{page}")
    public String toCPage(@PathVariable String page) {
        String url = "course/" + page;
        return url;
    }



}
